#include <bits/stdc++.h>

using namespace std;
#define int long long
const int inf = 0x3f3f3f3f;

void solve()
{
    int n; string s;
    cin >> n >> s;
    unordered_map<char, char> mp;
    for (char c = 'a', ch = 'z'; c < ch; c++, ch--) mp[c] = ch;
    for (char c = 'Z', ch = 'A'; ch < c; c--, ch++) mp[c] = ch;
    stack<char> st;
    for (auto e : s)
    {
        if (st.size() && mp[st.top()] == e) st.pop();
        else st.push(e);
    }
    cout << st.size() << endl;
}

signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int _ = 1;
    //cin >> _;
    while (_--)
    {
        solve();
    }
    return 0;
}